# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import wordAutoConstants

class WordAutoSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(WordAutoSubDirectiveTree, self).__init__(parent)
        self.createWordAutoTreeNode()

    def createWordAutoTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "wordAutoNode"
        self.setText(0,"Word自动化")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.startingWordDirective, "启动Word")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.exportingPDFFromWordDirective, "Word导出PDF")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.readingWordDirective, "读取Word文本")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.writingToWordDirective, "写入文本到Word")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.locatingWordCursorDirective, "定位Word光标")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.movingWordCursorDirective, "移动Word光标")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.replacingTextInWordDirective, "替换Word文本")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.readingTableInWordDirective, "读取Word表格")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.insertingTableToWordDirective, "插入Word表格")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.insertingImageToWordDirective, "插入图片")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.insertingHyperLinkToWordDirective, "插入超链接")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.savingWordDirective, "保存Word")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, wordAutoConstants.WordAutoConstants.closingWordDirective, "关闭Word")
